package com.demo.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@TableName("pd_physical_prevention_log")
@ApiModel(value = "PhysicalPreventionLog对象", description = "物理治疗表")
public class PhysicalPreventionLog implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("编号")
    @TableId(value = "physical_prevention_id", type = IdType.AUTO)
    private Integer physicalPreventionId;

    @ApiModelProperty("病人流水号")
    @TableField("patient_id")
    private Integer patientId;

    @ApiModelProperty("医嘱号")
    @TableField("vte_preventive_id")
    private Integer vtePreventiveId;

    @ApiModelProperty("his病人流水号")
    @TableField("his_patient_id")
    private Integer hisPatientId;

    @ApiModelProperty("开始时间")
    @TableField(value = "start_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date startTime;

    @ApiModelProperty("结束时间")
    @TableField("end_time")
    private Date endTime;

    @ApiModelProperty("mac地址")
    @TableField("mac_address")
    private String macAddress;

    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createdTime;

    @ApiModelProperty("更新时间")
    @TableField(value = "updated_time", fill = FieldFill.UPDATE, update = "NOW()")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedTime;

    public PhysicalPreventionLog() {
    }

    public PhysicalPreventionLog(Integer vtePreventiveId, Integer hisPatientId, Date startTime, Date endTime, String macAddress) {
        this.vtePreventiveId = vtePreventiveId;
        this.hisPatientId = hisPatientId;
        this.startTime = startTime;
        this.endTime = endTime;
        this.macAddress = macAddress;
    }
}
